﻿using Common.Core.Serialization;
using Common.Unity.Extensions.Configuration;
using Microsoft.Practices.ObjectBuilder2;

namespace Common.Unity.Extensions.Serialization.Configuration
{
	public class XamlFileSerializationPolicy : PolicyCreatorBase
	{
		public string FilePath { get; set; }

		protected override IBuilderPolicy CreateInstance()
		{
			var resolver = new FileStreamResolver( FilePath );
			var result = new XamlSerializationPolicy( resolver );
			return result;
		}
	}
}
